<template>
  <ul class="todo-main">
    <transition-group name="item" appear>
      <MyItem v-for="todoObj in todoList" :key="todoObj.id" :todo="todoObj"/>
    </transition-group>
  </ul>

</template>

<script>
import MyItem from "./MyItem.vue";

export default {
  name: "MyList",
  components: {
    MyItem
  },
  props: ['todoList'],
  data() {
    return {
    }
  },
  methods: {

  }

}
</script>

<style scoped>
/*main*/
.todo-main {
  margin-left: 0px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding: 0px;
}

.todo-empty {
  height: 40px;
  line-height: 40px;
  border: 1px solid #ddd;
  border-radius: 2px;
  padding-left: 5px;
  margin-top: 10px;
}


/* 动画  */
/*进入的起点*/ /*离开的终点*/
.item-enter,.item-leave-to {
  transform: translateX(100%);
}
/*进入的终点*/ /*离开的起点*/
.item-enter-to,.item-leave{
  transform: translateX(0);
}
.item-enter-active,.item-leave-active {
  transition: 1s ease;
}
</style>